#include <stdio.h>
#include <string.h>

char *my_strcpy(char *dest, const char *src){
	char *temp = dest; // 保存目标字符串首地址 防止后面使用是找不到了
	while('\0' != *src){
		*temp = *src;
		temp++;
		src++;
	}
	*temp = *src;
	return dest;
}

int main(int argc, const char *argv[])
{
	char s1[32] = "hello";
	char s2[32] = "beijing";
	char s3[32] = "xja";

	//strcpy(s1, strcpy(s2, s3)); // 相当于 s1 = s2 = s3 
	
	my_strcpy(s1, my_strcpy(s2, s3)); 

	printf("s1 = [%s]\n", s1); // xja
	printf("s2 = [%s]\n", s2); // xja
	printf("s3 = [%s]\n", s3); // xja

	return 0;
}
